import { defineConfig, loadEnv } from "vite";
import vue from "@vitejs/plugin-vue";
import path from "path";

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      "@": path.resolve("./src"),
    },
  },
  server: {
    // host: "10.1.36.141", // 监听所有网络接口
    host: "10.1.38.89",
    // host: "192.168.10.197", // 监听所有网络接口
    // host: "172.20.10.3",
    port: 8000, // 指定端口号
    open: true,
    proxy: {
      "/api": {
        // target: "http://192.168.10.10:8091",
        // target: "http://10.1.37.162:8091",
        // target: "http://10.1.32.125:8000",
        // target: "http://10.187.140.49:32676",//徐工服务器
        target: "https://e43112a149cd2dabe8.gradio.live",//AI下拉表格
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ""),
      },
    },
  },
});
